<script setup lang="ts">
// import logohbwsw from 'src/assets/home/org-hbwsw.png'

// import logozgwsw from 'src/assets/home/org-zgwsw.png'
import OrgCard from './OrgCard.vue'
import h5bg from '~/assets/home/h5-home5.jpg'
import bg from '~/assets/home/home_3_06.png'

// const logos = [
//   [
//     {
//       logo: logoHuanong,
//       unit: '华中农业大学',
//       info: '主办方',
//       url: 'http://www.hzau.edu.cn/',
//     },
//     {
//       logo: logokx,
//       unit: '湖北省科学技术协会',
//       info: '主办方',
//       url: 'http://www.hbkx.org.cn/',
//     }
//   ],
//   [
//     {
//       logo: logosky,
//       unit: '华中农业大学生命科学技术学院',
//       info: '承办方',
//       url: 'http://lst.hzau.edu.cn/',
//     },
//     {
//       logo: logojksw,
//       unit: '微康益生菌（苏州）股份有限公司',
//       info: '赞助商',
//       url: 'http://www.wecare-bio.com/',
//     },
//   ],
//   [
//     {
//       logo: logoHuanong,
//       unit: '华中农业大学现代农业生命科学技术科普基地',
//       info: '承办方',
//       url: 'http://lst.hzau.edu.cn/',
//     }, {
//       logo: logoHuanong,
//       unit: '华中农业大学科学技术协会',
//       info: '承办方',
//       url: 'http://www.hzau.edu.cn/',
//     },

//   ],
// ]

import { orgList } from '~/api'

const { basicInfo } = storeToRefs(useTeamInfoStore())
const logos = ref([])

onMounted(async () => {
// SPONSOR("主办方"),
// UNDERTAKE("承办方"),
// ASSIST("协办方");
  const res = basicInfo.value?.scheduleId ? await orgList(basicInfo.value.scheduleId) : { data: [] }
  logos.value = res.data
})
</script>

<template>
  <PageItem :bg="bg" :h5bg="h5bg" show-footer title="组织机构" :content-style="{ flex: 1, marginBottom: '1rem' }">
    <div pb-4 lt-lg="mt-0 " flex="~ gap-8 justify-center wrap lt-lg:(gap-2)">
      <div v-for="(arr, i) of logos" :key="i" flex="~ gap-8 justify-center wrap lt-lg:(gap-2)" lt-lg="transform" style="width:100%">
        <OrgCard v-for="item of arr" :key="item.id" :url="item.url" :info="item.orgType == 'SPONSOR' ? '主办方' : item.orgType == 'UNDERTAKE' ? '承办方' : item.orgType == 'ASSIST' ? '协办方' : item.orgType == 'ZANZU' ? '赞助方' : ''" :logo="getAssetUrl(item.orgLogoVo.fileUrl)" :unit="item.orgName" class="max-w-1/3 min-w-1/4 flex-1 lt-lg:(max-w-1/2 min-w-2/5)" />
      </div>
      <!-- <OrgCard v-for="item of logos" :key="item.id" :url="item.orgType" :info="item.orgType == 'SPONSOR' ? '主办方' : item.orgType == 'UNDERTAKE' ? '承办方' : '协办方'" :logo="item.orgLogoVo.fileUrl" :unit="item.orgName" class="max-w-1/3 min-w-1/4 flex-1 lt-lg:(max-w-1/2 min-w-2/5)" /> -->
    </div>
  </PageItem>
</template>

<style scoped>
:deep(.n-scrollbar-rail.n-scrollbar-rail--vertical) {
  display: none;
}
</style>
